package com.neuronbit.businessflow.intellij.model;

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * The type Param.
 */
@Getter
public class Param implements Serializable {
    @Setter
    private String index;
    @Setter
    private String description;
    private /*@Nullable */ParamValue value;
    @Setter
    private Object defaultValue;
    @Setter
    private String name;
    /**
     * 这个字段不应该被序列化，否则需要维持其一致性
     */
    @Setter
    private Type type;

    /**
     * Instantiates a new Param.
     */
    public Param() {
    }

    /**
     * Instantiates a new Param.
     *
     * @param index the index
     * @param value the value
     */
    public Param(String index, String value) {
        this.index = index;
        setValue(value);
    }

    /**
     * Sets value.
     *
     * @param value the value
     */
    public void setValue(String value) {
        this.value = new ParamValue(value);
    }

    /**
     * Sets value.
     *
     * @param value the value
     */
    public void setValue(ParamValue value) {
        this.value = value;
    }
}
